//------------------------------------------------------------------------------
// <safe-for-custom-code>
//     This code file was provided by Radarc (http://radarc.net) - Radarc version: 3.1.0.0 Formula: Power Template Formula version: 1.3
//
//     It is safe to add and maintain your custom code here. Radarc will not override it unless this file is missing.
// </safe-for-custom-code>
//------------------------------------------------------------------------------
using System.Linq;


namespace ShopPowerTemplate.Entities
{
    public partial class Product : ProductBase
    {
        public double AverageReview
        {
            get 
            {
                if (Reviews != null && Reviews.Count > 0)
                {
                    return Reviews.Average(x => x.Rating);
                }
                return 0.0;
            }
        }
	}
}
